home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Please help w/seemingly simple problem...
- Date: 10 Apr 1996 08:04 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <10APR199608042663@erich.triumf.ca>
- References: <4ke19f$m6r@freenet.vcu.edu>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4ke19f$m6r@freenet.vcu.edu>, damurr@freenet.vcu.edu writes...
- >/*
- >
- >I'm hoping you guys can help me here... I have NO idea what's wrong
- >with this code, but I can't get it to display the second screen
- >that says, " - Options Menu - ". I can't go any further because it won't
- >do anything beyond the first file id screen. The IDE debugger doesn't
- >help me at all.
-
- > #define string "\r"
-
- Now, anytime you use 'string' in your source, it will be replaced by '"\r"'
-
- > scanf(string);
- so this becomes scanf("\r");
- >
- > if (string="\r"");
- and this becomes if("\r" = "\r");
-
- Perhaps you want something like this:
- int ch;
- ch = getch();
- if(ch == '\r')
- ....
-
- Note that "\r" is a string of _two_ chars, \r and \0, while '\r' is a single
- char.
-
- Also, you can't compare strings with '==', you need to use the strcmp()
- function. (and '=' does an assignment, not a comparison)
-
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-